<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="Modificar Cliente"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="" for="customerid" />
                    <h:inputHidden id="customerid" value="#{customerController.selected.customerid}"   ></h:inputHidden>
                                     
                    <h:outputLabel value="Nombres" for="customerfirstname" />
                    <h:inputText id="customerfirstname" value="#{customerController.selected.customerfirstname}" title="Nombres"   requiredMessage="Ingrese los Nombres"/>
                    
                    <h:outputLabel value="Apellidos" for="customerlastname" />
                    <h:inputText id="customerlastname" value="#{customerController.selected.customerlastname}" title="Apellidos"   requiredMessage="Ingrese los Apellidos"/>
                    
                    <h:outputLabel value="Correo Electronico" for="customeremail" />
                    <h:inputText id="customeremail" value="#{customerController.selected.customeremail}" title="Correo Electronico"  requiredMessage="Ingrese el Correo Electronico"/>
                    
                    <h:outputLabel value="Clave Internet" for="customerpassword" />
                    <h:inputText id="customerpassword" value="#{customerController.selected.customerpassword}" title="Clave Internet"  requiredMessage="Ingrese la clave Internet"/>
                    
                    <h:outputLabel value="Tipo de Cliente" for="customertype" />
                    <h:selectOneMenu id="customertype2" value="#{customerController.selected.customertype}" title="Tipo de Cliente" >
                         <f:selectItems value="#{customerController.clientCategorysItems}"/>
                    </h:selectOneMenu>
                    
                    <h:outputLabel value="Numero de Documento" for="customerdocument" />
                    <h:inputText id="customerdocument" value="#{customerController.selected.customerdocument}" disabled="true"  title="Numero de Documento"  requiredMessage="Ingrese el Numero de Documento"/>
                    
                    <h:outputLabel value="Ultima Tarjeta de Credito" for="lastusedcreditcardid"  />
                    <h:inputText id="lastusedcreditcardid" value="#{customerController.currentLastCreditCard}" disabled="true" title="Ultima Tarjeta de Credito"  requiredMessage="Ingrese TC"/>
                
                    <h:outputLabel value="Ultima Direccion" for="lastusedaddressid" />
                    <h:inputText id="lastusedaddressid" value="#{customerController.currentLastAddress}" disabled="true" title="Ultima Direccion"  requiredMessage="Ingrese Direccion"/>
               
                </h:panelGrid>
                <h:commandLink action="#{customerController.update}" value="Modificar"/>
                <br />
                <br />
                <h:commandLink action="View" value="Ver Cliente" immediate="true"/>
                <br />
                <h:commandLink action="#{customerController.prepareList}" value="Ver Todos los Clientes" immediate="true"/>
                <br />
                
                <h:commandLink action="#{customerController.creditcard}"  value="Adicionar Tarjeta Credito" immediate="true"/>
                <br />
                 
                
                <h:commandLink action="#{customerController.address}"  value="Adicionar Direccion" immediate="true"/>
                <br />
                <h:commandLink value="Menu Principal" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
